import { unsafeWindow } from "./utils/monkeyTool/monkeyApi" 
import {hookStart,monkeyTool,hookEnd} from "./utils/monkeyTool/index"
import { render } from "./utils/index"
import { routerApi } from "./hooks/routers"
// 注册工具按钮
monkeyTool.registerMenuCommand()
const injectTool = monkeyTool.inject()
if(injectTool){
  hookStart.saas_web_fetch_hook()
  hookStart.xhr_Hook()
  hookEnd()
  unsafeWindow.addEventListener('load',()=> {
    if(location.href.includes("login")&&!location.href.includes("localhost")){
      sessionStorage.clear()
    }
    hookStart.xhr_Hook()
    routerApi.start()
    setTimeout(()=>{
      const visible = monkeyTool.visible()
      render(visible)
    },1000)
  })
}




